import React from "react";

export const EditableContext = React.createContext<any>({});
export const getRenderColumns = (columns: any, handleSave: Function) => {
    return columns.map((col: any) => {
        if (!col.editable) {
            return col;
        }
        return {
            ...col,
            onCell: (record: any) => ({
                record,
                editable: col.editable,
                dataIndex: col.dataIndex,
                title: col.title,
                handleSave,
            }),
        };
    });
};
